<template>
  <!-- SKU 选择的提示框 -->
  <detail-cell :label="$t('goods.detail.cell.select')" :value="value" />
</template>

<script setup>
  import { computed } from 'vue';
  import detailCell from './detail-cell.vue';
  import { t } from '@/i18n/solveSetup';

  const props = defineProps({
    modelValue: {
      type: Array,
      default() {
        return [];
      },
    },
    sku: {
      type: Object,
    },
  });

  const value = computed(() => {
    if (!props.sku?.id) {
      return t('goods.detail.cell.pleaseSelectSpecification');
    }
    let str = '';
    props.sku.properties.forEach((property) => {
      str += property.propertyName + ':' + property.valueName + ' ';
    });
    return str;
  });
</script>
